<?php
session_start();
if (!isset($_SESSION['id'])) {
    header('location:index.php?msg=Login Please');
}

$file_path = $_SERVER['REQUEST_URI'];
$file_path = explode('/', $file_path);

$file_name = array_pop($file_path);
//vd($file_name);

$isHomeActive = '';
$isJobActive = ($file_name == 'current_opening.php') ? 'active' : '';
$isTeamActive = ($file_name == 'our_team.php') ? 'active' : '';
$isContActive = ($file_name == 'contact_us.php') ? 'active' : '';
$isDevlpActive = ($file_name == 'development.php') ? 'active' : '';
$isBannerActive = ($file_name == 'banners.php') ? 'active' : '';
$isProjectActive = ($file_name == 'latestproject.php') ? 'active' : '';
$isPActive = ($file_name == 'pages.php') ? 'active' : '';
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
        <style>
            .error
            {
                color: red;
            }
        </style>

        <link rel="stylesheet" href="../css/flexslider.css" type="text/css">
        <link rel="stylesheet" href="../css/style.css" />
        <link rel="stylesheet" href="../css/inner.css" />
        <link rel="stylesheet" href="../css/layout.css" />
        <link rel="stylesheet" href="../css/color.css" />
        <link rel="stylesheet" href="../css/prettyPhoto.css"  media="screen" />

        <!--[if lt IE 9]>
                        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
                <![endif]-->

        <!-- Favicons
                ================================================== -->
        <!--<link rel="shortcut icon" href="images/favicon.ico" />-->
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="">
        <meta name="author" content="">
        <link rel="shortcut icon" href="../images/favicon.png">

        <title>Cyberlinks Admin</title>

        <!-- Bootstrap core CSS -->
        <link href="css/bootstrap.min.css" rel="stylesheet">

        <!-- Custom styles for this template -->
        <link href="css/dashboard.css" rel="stylesheet">

        <!-- Just for debugging purposes. Don't actually copy this line! -->
        <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>

    <body>

        <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <div class="container-fluid">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#">Cyberlinks Admin</a>
                </div>
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="#"></a></li>
                        <li><a>Welcome !</a></li>
                        <li><a><span class="glyphicon glyphicon-user"></span>&nbsp;<?= $_SESSION['name'] ?></a></li>
                        <li><a href="logout.php">Logout</a></li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-3 col-md-2 sidebar">
                    <ul class="nav nav-sidebar">

                        <li class="<?= $isJobActive ?>"><a href="current_opening.php"><span class="glyphicon glyphicon-briefcase"></span>&nbsp;Job Openings</a></li>
                        <li class="<?= $isTeamActive ?>"><a href="our_team.php"><span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;Team Member</a></li>
                        <li><a href="#"><span class="glyphicon glyphicon-print"></span>&nbsp;Job Applications</a></li>
                        <li class="<?= $isContActive ?>"><a href="contact_us.php"><span class="glyphicon glyphicon-envelope"></span>&nbsp;Contact Us</a></li>
                        <li class="<?= $isDevlpActive ?>"><a href="development.php"><span class="glyphicon glyphicon-cloud-upload"></span>&nbsp;Development</a></li>
                        <li class="<?= $isBannerActive ?>"><a href="banners.php"><span class="glyphicon glyphicon-flash"></span>&nbsp;Banners</a></li>
                        <li class="<?= $isProjectActive ?>"><a href="latestproject.php"><span class="glyphicon glyphicon-usd"></span>&nbsp;Latest Project</a></li>
                        <li class="<?= $isPActive ?>"><a href="pages.php"><span class="glyphicon glyphicon-th-list"></span>&nbsp;Pages</a></li>

                    </ul>

                </div>

            </div>
        </div>

        <!-- Bootstrap core JavaScript
        ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/docs.min.js"></script>
    </body>
</html>
